<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <title>订单列表</title>
<%@ include file="../common/link.jsp" %>
<%@ include file="../common/script.jsp" %>
<script type="text/javascript">
$(window).load(function(){
	$('#demo-side-bar').removeAttr('style');
});
function foo(){  
    if(confirm("该订单还未完成，您可以在完成之后删除该订单！！！")){  
        return true;  
    }  
    return false;  
 } 
</script>
<style type="text/css">
.demobar{display:none;}
#demo-side-bar{top:53px!important;left:90%!important;display:block!important;}
</style>
<%@ include file="../common/header.jsp" %>
    <!-- START CONTENT -->
    <section class="container clearfix">
		<!-- Page Title -->
			<header class="container page_info clearfix">
					<h1 class="regular brown bottom_line">我的订单</h1>
				<div class="clear"></div>
			</header>
		<div class="row-fluid sortable " border="1" >
			<div class="box span12">
				<div>
			<table class="">
				<thead>
					<tr>
						<th><h4>编号</h4></th>
						<th><h4>取货码</h4></th>
						<th><h4>取货地址</h4></th>
						<th><h4>送货地址</h4></th>
						<th><h4>报酬</h4></th>
						<th><h4>状态</h4></th>
						<th><h4>操作</h4></th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${!empty ordersMyList }">
						<c:forEach items="${ordersMyList}" var="o" varStatus="oList">
							<tr>
								<td><h5>${oList.index+1 }</h5></td>
								<td class="center"><h5>${o.emgId}</h5></td>
								<td class="center"><h5>${o.hoStplace}</h5></td>
								<td class="center"><h5>${o.hoPlace}</h5></td>
								<td class="center"><h5>${o.hoPrice}</h5>
								<td><h5>
								<c:if test="${o.hoState==0 }">
                    				未抢
                    			</c:if>
                    			<c:if test="${o.hoState==1 }">
                    				已抢
                    			</c:if>
                    			<c:if test="${o.hoState==2}">
                    				完成
                   				</c:if>
								</h5></td>
								<td class="center">
								
								<c:choose>
									<c:when test="${o.hoState==0 }">
										<a href="${pageContext.request.contextPath}/order/orderDetail?hoId=${o.hoId}" class="button navy">详情</a>
										<a href="javascript:return false;" class="button navy">完成</a>
										<a href="${pageContext.request.contextPath}/order/delMyOrder?hoId=${o.hoId}" class="button navy">删除</a>
									</c:when>
									<c:when test="${o.hoState==1 }">
										<a href="${pageContext.request.contextPath}/order/orderDetail?hoId=${o.hoId}" class="button navy">详情</a>
										<a href="${pageContext.request.contextPath}/order/changeState?userId=${o.userId }&hoId=${o.hoId }&hoState=${o.hoState}" class="button navy">完成</a>
										<a href="javascript:return false;" onclick="return foo();" class="button navy">删除</a>
									</c:when>
									<c:when test="${o.hoState==2 }">
										<a href="${pageContext.request.contextPath}/order/orderDetail?hoId=${o.hoId}" class="button navy">详情</a>
										<a href="javascript:return false;" class="button navy">完成</a>
										<a href="${pageContext.request.contextPath}/order/delMyOrder?hoId=${o.hoId}" class="button navy">删除</a>
									</c:when>
								</c:choose>
								</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
			</div><!--/span-->
		</div>
		<div class="clear padding20"></div>
		<div class="clear"></div>
	</section>
    <!-- END CONTENT -->
<%@ include file="../common/footer.jsp" %>  
</body>
</html>